<div class="stock" ng-controller="stock">
	<ol class="breadcrumb">
		<h3>库存管理：</h3>
		<li><span ng-click="point = 'search'" ng-class="{active: point === 'search'}">查询</span></li>
		<li><span ng-click="point = 'modify'" ng-class="{active: point === 'modify'}">修改</span></li>
	</ol>

	<section class="searchStock" ng-controller="searchStock" ng-show="point === 'search'">
		<form class="form-inline">
			<div class="form-group">
				<label>条形码：</label>
				<input type="text" class="form-control" ng-model="barcode">
			</div>
			<button type="button" class="btn btn-default" ng-click="searchStockByInfo(0)">查询本店库存</button>
			<div class="form-group">
				<select class="form-control" ng-model="storageId1" ng-options="storage.storageId as storage.name for storage in allStorage">
					<option value="">-- 仓库 --</option>
				</select>
			</div>
			<button type="button" class="btn btn-default" ng-click="searchStockByInfo(1)">查询仓库库存</button>
		</form>

		<form class="form-inline">
			<button type="button" class="btn btn-default" ng-click="searchAllStock(0)">查询本店所有商品的库存</button>
			<div class="form-group">
				<select class="form-control" ng-model="storageId2" ng-options="storage.storageId as storage.name for storage in allStorage">
					<option value="">-- 仓库 --</option>
				</select>
			</div>
			<button type="button" class="btn btn-default" ng-click="searchAllStock(1)">查询仓库所有商品的库存</button>
		</form>

		<div class="result table-responsive">
			<table class="table table-bordered table-hover" ng-show="allStock.length !== 0">
				<tr>
					<th>#</th>
					<th>条形码</th>
					<th>数量</th>
				</tr>
				<tr ng-repeat="stock in allStock">
					<td>{{$index+1}}</td>
					<td>{{stock.barcode}}</td>
					<td>{{stock.quantity}}</td>
				</tr>
			</table>
		</div>

	</section>


	<section class="modifyStock" ng-show="point === 'modify'" ng-controller="modifyStock">
		<form class="form-inline">
			<div class="form-group">
				<label>条形码：</label>
				<input type="text" class="form-control" ng-model="barcode">
			</div>
		</form>
		<form class="form-inline">
			<button type="button" class="btn btn-default" ng-click="searchStockByInfo(0)">查询本店库存</button>
			<div class="form-group">
				<label>数量：</label>
				<input type="text" class="form-control" ng-model="shopQuantity" ng-disabled="true">
			</div>
			<div class="form-group">
				<label>更新数量：</label>
				<input type="text" class="form-control" ng-model="updateShopQuantity">
			</div>
			<button type="button" class="btn btn-default" ng-click="updateShopStock()">更新库存</button>
			<button type="button" class="btn btn-default" ng-click="cancle(0)">取 消</button>
		</form>

		<form class="form-inline">
			<div class="form-group">
				<select class="form-control" ng-model="storageId" ng-options="storage.storageId as storage.name for storage in allStorage">
					<option value="">-- 仓库 --</option>
				</select>
			</div>
			<button type="button" class="btn btn-default" ng-click="searchStockByInfo(1)">查询仓库库存</button>
			<div class="form-group">
				<label>数量：</label>
				<input type="text" class="form-control" ng-model="storageQuantity" ng-disabled="true">
			</div>
			<div class="form-group">
				<label>更新数量：</label>
				<input type="text" class="form-control" ng-model="updateStorageQuantity">
			</div>
			<button type="button" class="btn btn-default" ng-click="updateStorageStock()">更新库存</button>
			<button type="button" class="btn btn-default" ng-click="cancle(1)">取 消</button>
		</form>

	</section>

</div>